<template>
	<!-- 房间操作 -->
	<view class="room-box">
		<view class="room-info" hover-class="room-info2" @click="copyMetting">
			<view class="room-item" >
				<view class="roomtit">会议号</view>
				<view class="roomdesc">{{roomInfo.tag}}</view>
			</view>
			<view class="room-item">
				<view class="roomtit">发起人</view>
				<view class="roomdesc">{{roomInfo.name}}</view>
			</view>
		</view>
		
		<!-- <view class="room-control" hover-class="room-control2" @click="handleAddUser">
			<view class="roomtit">添加成员</view>
			<view class="cuIcon cuIcon-roundadd text-green"></view>
		</view> -->
		<view class="room-control" v-if="Ispermission" hover-class="room-control2" @click = "handleDisableMic">
			<view class="roomtit">全员禁言</view>
			<view class="roomdesc" >
				<u-switch activeColor="#05c160" :value="Ismicrophone"  ></u-switch>
			</view>
		</view>
		<view class="close-btn" hover-class="close-btn2" @click="closeMetting">
			退出会议
		</view>
	</view>
</template>

<script>
import core from '@/core';
export default{
	data(){
		return{
			roomMute:false
		}
	},
	props:{
		roomInfo: {
			type: Object,
			default: function() {
				return {};
			}
		},
		Ismicrophone:{
			type:Boolean,
			default:()=>{
				return false
			}
		},
		Ispermission:{
			type:Boolean,
			default:()=>{
				return false
			}
		},
	},
	methods:{
		closeMetting(){
			this.$emit('closeMetting');
		},
		handleDisableMic(){
			this.$emit('handleDisableMic');
		},
		handleAddUser(){
			this.$emit('handleAddUser');
		},
		copyMetting(){
			let text = this.roomInfo.tag;
			core.copy(text,'会议号已复制到粘贴板')
		}
	}
}
</script>

<style lang="scss" scoped>
.room-box{
	margin-top: 40upx;
	padding: 0 30rpx;
	.room-info{
		background-color: #aed089;
		border-radius: 10rpx;
	}
	.room-info2{
		background-color: #9cbc7d;
	}
	.room-item{
		border-bottom: none;
		display: flex;
		justify-content: space-between;
		line-height: 90rpx;
		padding: 0 20rpx;
		color: #373738;
		&:first-child{
			border-bottom: 1rpx #373738 solid;
		}
		.roomtit{
			
		}
		.roomdesc{
			text-align: right;
			font-size: 30rpx;
			font-weight: bold;
		}
	}
	.room-control{
		padding: 0 20rpx;
		display: flex;
		justify-content: space-between;
		line-height: 140rpx;
		align-items: center;
		border-radius: 10rpx;
		.cuIcon{
			font-size: 40rpx;
		}
	}
	.room-control2{
		background-color: #d5d5d5;
	}
}
.close-btn{
	width: 100%;
	height: 100rpx;
	line-height: 100rpx;
	background-color: #bc4048;
	color: #fff;
	text-align: center;
	border-radius: 10rpx;
	font-size: 35rpx;
	margin: 30rpx auto;
}
.close-btn2{
	background-color: #9f373e;
}
</style>